﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using MvcProject.Models;

namespace MvcProject.Services
{
    /// <summary>
    /// FormCheck 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    [System.Web.Script.Services.ScriptService]
    public class FormCheck : System.Web.Services.WebService
    {
        /// <summary>
        /// 检测定额号是否重复
        /// </summary>
        /// <param name="ratedCode"></param>
        /// <returns></returns>
        [WebMethod]
        public bool ExistRatedCode(string ratedCode)
        {
            BaseModels db = new BaseModels();
            return db.ExistRatedCode(ratedCode);
        }
        /// <summary>
        /// 通过定额号获取定额名称
        /// </summary>
        /// <param name="ratedCode"></param>
        /// <returns></returns>
        [WebMethod]
        public string GetRatedNameByRatedCode(string ratedCode)
        {
            BaseModels db = new BaseModels();
            return db.GetRatedNameByRatedCode(ratedCode);
        }
        [WebMethod]
        public bool SaveRatedInfosToGroup(string ratedInfos, int adjustment,int teamId)
        {
            bool flag = false;
            BaseModels db = new BaseModels();
            flag = db.SaveRatedInfosToGroup(ratedInfos, adjustment, teamId);
            return flag;
        }
    }
}
